Skip to content

Conversation

@chrismcg
Copy link
Contributor

Previously setting bundling to undefined would make the AssetStaging in CDK copy the rootDir into the cdk.out folder. If the cdk.out folder was part of the rootDir then this caused recursive copying and an eventual error. [1]

Calling cdk list would trigger this as it sets bundlingRequired to false which sets skip to true.

The code now handles skip being true and doesn't try to find Python versions or do anything that would require the actual asset contents to be there.

Tests are updated to align more with how the code is called when ran by CDK.

[1] https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/core/lib/asset-staging.ts#L194-L201 is where stageByCopying() gets called when bundling is undefined.

Previously setting bundling to `undefined` would make the AssetStaging in CDK
copy the rootDir into the cdk.out folder. If the cdk.out folder was part of the
rootDir then this caused recursive copying and an eventual error.

Calling `cdk list` would trigger this as it sets `bundlingRequired` to `false`
which sets `skip` to true.

The code now handles `skip` being true and doesn't try to find Python versions
or do anything that would require the actual asset contents to be there.

Tests are updated to align more with how the code is called when ran by CDK.
@chrismcg chrismcg requested a review from eoinsha November 27, 2024 15:28
@chrismcg chrismcg changed the title Fix skip behaviour and recursive copying fix: skip behaviour and recursive copying Nov 27, 2024
Copy link
Contributor

@eoinsha eoinsha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chrismcg chrismcg merged commit 4b4a0e8 into main Nov 27, 2024
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants